Ch.18 Applications

Return to TOC

Stochastic Matrices

A matrix is stochastic if all entries are nonnegative and the sum of the entries of each column are 11.
If every entry is positive the matrix is said to be positive
These are common in probabilistic phenomena (Markov chains)

Suppose a movie can be rented from location 1, 2, or 3 and returned to any location. Let AA be matrix whose ijij entry is the probability a customer renting a movie from location jj returns it to location ii
A=(.3.4.5.3.4.3.4.2.2)A=\begin{pmatrix}.3&.4&.5\\.3&.4&.3\\.4&.2&.2\end{pmatrix}
The columns sum to 1 because a movie rented has a 100%100\% chance of getting returned to some location.

Now, let v=(x,y,z)v=(x,y,z) represent the number of movies at the three locations. Then there will be approximately
Av=A(xyz)=(.3x+.4y+.5z.3x+.4y+.3z.4x+.2y+.2z)Av=A\begin{pmatrix}x\\y\\z\end{pmatrix}=\begin{pmatrix}.3x+.4y+.5z\\.3x+.4y+.3z\\.4x+.2y+.2z\end{pmatrix}
movies in the three locations the next day. Since the columns add to 1, the total number won't change.

If xn,yn,znx_n,y_n,z_n are the number of movies in location 1,2,3,1,2,3, on day nn, then
vn=Avn1=A2vn2==Anv0v_n=Av_{n-1}=A^2v_{n-2}=\cdots=A^nv_0

An iterationvn+1=Avnv_{n+1}=Av_n is used to model a state change controlled by a matrix:

Eigenvalues

To compute Anv0A^nv_0, it can help to use eigenvalues.
A stochastic matrix always has an eigenvalue of 11.

Proof

Consider 3×33\times3 stochastic matrix
A=(x1y1z1x2y232x3y3z3)A=\begin{pmatrix}x_1&y_1&z_1\\x_2&y_2&3_2\\x_3&y_3&z_3\end{pmatrix}
Since the columns add to 11, the rows of ATA^T add to 11. Thus, (1,1,1)(1,1,1) is an eigenvector with eigenvalue 11.
(x1x2x3y1y2y3z1z2z3)(111)=(x1+x2+x3y1+y2+y3z1+z2+z3)=1(111)\begin{pmatrix}x_1&x_2&x_3\\y_1&y_2&y_3\\z_1&z_2&z_3\end{pmatrix}\begin{pmatrix}1\\1\\1\end{pmatrix}=\begin{pmatrix}x_1+x_2+x_3\\y_1+y_2+y_3\\z_1+z_2+z_3\end{pmatrix}=1\cdot\begin{pmatrix}1\\1\\1\end{pmatrix}

Any other eigenvalue is less than 11. That is, 11 is the largest eigenvalue of a stochastic matrix.

Proof

Let v=(x1x2xn)v=\begin{pmatrix}x_1\\x_2\\\vdots\\x_n\end{pmatrix} be an eigenvalue of positive stochastic matrix AA.
λv=ATvλxj=i=1naijxi\lambda v=A^Tv\implies \lambda x_j=\sum_{i=1}^na_{ij}x_i
Choose xjx_j with the largest absolute value, so that xixj|x_i|\le|x_j for all ii. Then
λxj=i=1naijxii=1naijxii=1naijxj=1xj|\lambda|\cdot|x_j|=\left|\sum_{i=1}^na_{ij}x_i\right|\le\sum_{i=1}^na_{ij}|x_i|\le\sum_{i=1}^na_{ij}|x_j|=1\cdot|x_j|
The first inequality is valid since AA is a positive matrix. The final equality holds since AA is stochastic.

Let A=(3/41/41/43/4)A=\begin{pmatrix}3/4&1/4\\1/4&3/4\end{pmatrix}. AA is diagonalizable, with A=PDP1A=PDP^{-1} where
P=(1111)D=(1001/2)\begin{array}{cc}P=\begin{pmatrix}1&1\\1&-1\end{pmatrix}&D=\begin{pmatrix}1&0\\0&1/2\end{pmatrix}\end{array}

Diagonalization Process

The characteristic polynomial is (3/4λ)2(1/4)2(3/4-\lambda)^2-(1/4)^2, so the eigenvalues are 11 and 1/21/2.
Thus, D=(1001/2)D=\begin{pmatrix}1&0\\0&1/2\end{pmatrix}
An eigenvector with associated eigenvalue 11 is (11)\begin{pmatrix}1\\1\end{pmatrix}, as seen before.
An eigenvector with associated eigenvalue 1/21/2 can be found by solving (A1/2I)v=0(A-1/2I)v=0
(1/41/41/41/4)(xy)=0\begin{pmatrix}1/4&1/4\\1/4&1/4\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}=0
gives the solution set {(11)t  tR}\{\begin{pmatrix}1\\-1\end{pmatrix}t\space|\space t\in\mathbb{R}\}
So, we have P=(1111)P=\begin{pmatrix}1&1\\1&-1\end{pmatrix}

AnA^n acts on usual coordinates in the same way DD acts on B=w1=(11),w2=(11)B=\langle w_1=\begin{pmatrix}1\\1\end{pmatrix},w_2=\begin{pmatrix}1\\-1\end{pmatrix}\rangle, so RepB(Anx)=DnRepB(x)\text{Rep}_B(A^nx)=D^n\text{Rep}_B(x). Thus,
RepB(x)=(c1c2)RepB(Anx)=(1001/2n)(c1c2)=(c1c2/2n)\text{Rep}_B(x)=\begin{pmatrix}c_1\\c_2\end{pmatrix}\implies \text{Rep}_B(A^nx)=\begin{pmatrix}1&0\\0&1/2^n\end{pmatrix}\begin{pmatrix}c_1\\c_2\end{pmatrix}=\begin{pmatrix}c_1\\c_2/2^n\end{pmatrix}
Thus, Anx=c1w1+c2/2nw2A^nx=c_1w_1+c_2/2^nw_2. As nn grows larger, the second term approaches 00, so AnxA^nx approaches c1w1c_1w_1, an eigenvector with eigenvalue 11. So, all vectors get "sucked into" the 11-eigenspace spanned by (11)\begin{pmatrix}1\\1\end{pmatrix}

This means that after a sufficiently large iterations vn+1=Avnv_{n+1}=Av_n, the state does not change; i.e. Av=vAv=v. That vector vv in which the state stabilizes is in the 11-eigenspace of AA.

A steady state for stochastic matrix AA is an eigenvector ww with eigenvalue 11 such that all entries are positive and add to 11.

Perron-Frobenius Theorem

If AA is a positive stochastic matrix, then it has a unique steady state vector ww spanning the 11-eigenspace. Moreover, for any v0v_0 with entries summing to cc, Avn=Avn1vAv_n=Av_{n-1}v approaches cwcw.
In other words:

Google PageRank

importance rule: if page PP links to nn other pages Q1,...,QnQ_1,...,Q_n, then each QiQ_i inherits 1/n1/n of PP's importance

Consieder this 44-page network

We can compute an importance matrix

Each color corresponds to that page giving its inheritance to the pages it links to
By the importance rule, we can set the equation
(c+12d13a13a+12b+12d13a+12b)=(abcd)\begin{pmatrix}c+\frac{1}{2}d\\\frac{1}{3}a\\\frac{1}{3}a+\frac{1}{2}b+\frac{1}{2}d\\\frac{1}{3}a+\frac{1}{2}b\end{pmatrix}=\begin{pmatrix}a\\b\\c\\d\end{pmatrix}

We see that the importance matrix is a positive stochastic matrix and the rank vector is an eigenvector with eigenvalue 11. This is a steady state.

If a page links to no other page, its column will sum to 0, making the resulting matrix not stochastic.

Additionally, if there are two distinct "islands" of pages, there may be more than one eigenvector with eigenvalue 11.

To solve this, fix p(0,1)p\in(0,1), the dampening factor (typically p=0.15p=0.15). The Google Matrix is
M=(1p)+pB where B=1N(111111111),M=(1-p)+p\cdot B\text{ where }B=\frac{1}{N}\begin{pmatrix}1&1&\cdots&1\\1&1&\cdots&1\\\vdots&\vdots&\ddots&\vdots\\1&1&\cdots&1\end{pmatrix},
NN is the total number of pages, and AA is the importance matrix.

This is a stochastic matrix, and solves both of the problems above.